package com.wlyuan.open.controller;

import com.wlyuan.captcha.client.Captcha;
import com.wlyuan.captcha.client.CaptchaClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lijing
 */
@Slf4j
@Api(tags = "图形验证码")
@RequestMapping("/captcha")
@Validated
@RestController
@RequiredArgsConstructor
public class OpenCaptchaController {
    private final CaptchaClient captchaClient;

    @ApiOperation("获取图形验证码")
    @GetMapping("")
    public Captcha createCaptcha() {
        return captchaClient.create();
    }
}
